package tbdp.tool.core.spi.processor.sql;

import java.sql.Connection;

import tbdp.tool.core.db.DBUtil;
import tbdp.tool.core.db.DataBaseType;
import tbdp.tool.datasource.DataSourceConfig;

/**
 * @author xbkaishui
 * @version $Id: DataSource.java, v 0.1 2017-06-24 下午10:33 xbkaishui Exp $$
 */
public class DataSource {

    /**
     * 获取对应数据源的连接信息
     * @param dataSourceConfig
     * @return
     */
    public static Connection getConnection(DataSourceConfig dataSourceConfig) {
        return DBUtil.getConnection(DataBaseType.MySql, dataSourceConfig.getJdbcUrl(), dataSourceConfig.getUserName(), dataSourceConfig.getPassword());
    }
}
